package com.yt.user.models.dto;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.FieldFill;
import com.baomidou.mybatisplus.enums.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;

/**
 * 账号信息DTO
 *
 * @author yzz
 * @Date 2025-10-22 09:37:39
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("account_info")
@ApiModel(value="账号信息对象", description="账号信息对象")
public class AccountInfoDTO implements Serializable {

    /**
     * 使用字符串类型ID作为主键，直接映射数据库的id字段
     */
    @TableId(value = "id", type = IdType.NONE)
    @ApiModelProperty(value = "账号ID（主键）")
    private String id;

    @TableField("pre_deposit")
    @ApiModelProperty(value = "预存款金额（单位：分）")
    private Long preDeposit;
    
    @TableField("total_consumption")
    @ApiModelProperty(value = "累计消费金额（单位：分）")
    private Long totalConsumption;
    
    @TableField("month_consumption")
    @ApiModelProperty(value = "当月消费金额（单位：分）")
    private Long monthConsumption;
    
    @TableField("is_arrears")
    @ApiModelProperty(value = "是否欠费（0-否，1-是）")
    private Integer isArrears;
    
    @TableField("arrears_amount")
    @ApiModelProperty(value = "欠费金额（单位：分）")
    private Long arrearsAmount;
    
    @TableField("phone")
    @ApiModelProperty(value = "关联的用户手机号（外键，关联user_info表）")
    private String phone;
    
    // 显式声明时间字段以确保MyBatis Plus能正确识别和填充
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @ApiModelProperty("创建时间")
    private Date createTime;
    
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty("更新时间")
    private Date updateTime;
}